//
//  NSString+XSPath.m
//  WB
//
//  Created by Cedar on 16/10/17.
//  Copyright © 2016年 Cedar. All rights reserved.
//

#import "NSString+XSPath.h"

@implementation NSString (XSPath)
    
- (NSString *)xs_appendDocumentDir {
        NSString *dir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject;
        
        return [dir stringByAppendingPathComponent:self.lastPathComponent];
    }
    
- (NSString *)xs_appendCacheDir {
    NSString *dir = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject;
    
    return [dir stringByAppendingPathComponent:self.lastPathComponent];
}
    
- (NSString *)xs_appendTempDir {
    NSString *dir = NSTemporaryDirectory();
    
    return [dir stringByAppendingPathComponent:self.lastPathComponent];
}
    
@end
